package com.xbongbong.paas.service;

import com.xbongbong.paas.field.FieldAttrEntity;
import com.xbongbong.paas.pojo.dto.ChangePublicPoolModel2SeniorDTO;
import com.xbongbong.paas.pojo.dto.ChangePublicPoolModel2StandardDTO;
import com.xbongbong.paas.pojo.dto.ChangePublicPoolModelStatusDTO;
import com.xbongbong.paas.pojo.dto.ChangeRuleStatusDTO;
import com.xbongbong.paas.pojo.dto.ConfirmChangePublicPoolModelDTO;
import com.xbongbong.paas.pojo.dto.GroupApplyScoreGetDTO;
import com.xbongbong.paas.pojo.dto.GroupObjectiveGetDTO;
import com.xbongbong.paas.pojo.dto.RemindTimeGetDTO;
import com.xbongbong.paas.pojo.dto.RemindTimeSaveDTO;
import com.xbongbong.paas.pojo.dto.TransferBackRuleSeniorDetailDTO;
import com.xbongbong.paas.pojo.dto.TransferBackRuleSeniorSaveDTO;
import com.xbongbong.paas.pojo.vo.ChangePublicPoolModelSeniorVO;
import com.xbongbong.paas.pojo.vo.ChangePublicPoolModelStatusVO;
import com.xbongbong.paas.pojo.vo.CustomerRuleRemindTimeVO;
import com.xbongbong.paas.pojo.vo.TransferBackRuleSeniorItemVO;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import com.xbongbong.paas.toolbox.wrap.BaseVO;
import com.xbongbong.pro.publicgroup.pojo.vo.PublicGroupSeniorListVO;
import com.xbongbong.saas.enums.XbbRefTypeEnum;

/**
 * @author yanglei
 * @ProjectName xbb-pro
 * @Description: 公海高级模式Service
 * @date 2022/4/13 10:59
 */
public interface TransferBackRuleSeniorService {

    /**
     * 【web】保存公海高级规则规则
     *
     * @param transferBackRuleSeniorSaveDTO  前端传参
     * @return Integer
     * @throws XbbException 业务异常
     * @version v1.0
     * @since v1.0
     */
    Integer save(TransferBackRuleSeniorSaveDTO transferBackRuleSeniorSaveDTO) throws XbbException;

    /**
     *  获取高级公海规则的整体数据
     * @param backRuleSeniorDetailDTO 前端传参
     * @return
     * @throws XbbException 业务异常
     */
    TransferBackRuleSeniorItemVO getTransferBackRuleItem(TransferBackRuleSeniorDetailDTO backRuleSeniorDetailDTO) throws XbbException;

    /**
     * 获取目标公海分组列表
     * @param objectiveGetDTO
     * @return
     * @throws XbbException
     */
    PublicGroupSeniorListVO groupObjectiveGet(GroupObjectiveGetDTO objectiveGetDTO)throws XbbException;

    /**
     * 获取适用范围
     * @param applyScoreGetDTO
     * @return
     * @throws XbbException
     */
    PublicGroupSeniorListVO applyScoreGet( GroupApplyScoreGetDTO applyScoreGetDTO)throws XbbException;


    /**
     * 获取该公司高级模式和标准模式下开启的提醒时间天数
     * @param remindTimeDTO
     * @return
     */
    public CustomerRuleRemindTimeVO getRemindTime(RemindTimeGetDTO remindTimeDTO) throws XbbException;


    /**
     * 保存公海池提醒时间
     *
     * @param remindTimeSaveDTO 保存公海池提醒时间入参
     * @return Integer
     * @throws XbbException 业务异常
     * @version v1.0
     * @since v1.0
     */
    Integer saveRemindTime(RemindTimeSaveDTO remindTimeSaveDTO) throws XbbException;


    /**
     * 改变规则状态
     * @return
     */
    Integer changeRuleStatus(ChangeRuleStatusDTO ruleStatusDTO)throws XbbException;


    /**
     * 同步标准模式下分组、分配、退回、不退回、其他设置到高级模式下
     * @param changePublicPoolModel2SeniorDTO
     * @author lijiangren
     * @since v1.0
     * @version v1.0
     */
    ChangePublicPoolModelSeniorVO changePublicPoolModel2Senior(ChangePublicPoolModel2SeniorDTO changePublicPoolModel2SeniorDTO) throws XbbException;

    /**
     * 初始化表单解释时，特殊处理表单解释，确保公海分组字段解释在高级模式下保持开启
     * 涉及到的表单模板：客户、线索
     * @param xbbRefTypeEnum
     * @param fieldAttrEntity
     * @author lijiangren
     * @since v1.0
     * @version v1.0
     */
    void handlePublicGroupFieldEntity4Init(String corpid, XbbRefTypeEnum xbbRefTypeEnum, FieldAttrEntity fieldAttrEntity) throws XbbException;

    /**
     * 切换到标准模式
     * @param changePublicPoolModel2StandardDTO
     * @author lijiangren
     * @since v1.0
     * @version v1.0
     */
    BaseVO changePublicPoolModel2Standard(ChangePublicPoolModel2StandardDTO changePublicPoolModel2StandardDTO) throws XbbException;

    ChangePublicPoolModelStatusVO getChangePublicPoolStatus(ChangePublicPoolModelStatusDTO changePublicPoolModelStatusDTO) throws XbbException;

    BaseVO confirmChangePublicPoolComplete(ConfirmChangePublicPoolModelDTO confirmChangePublicPoolModelDTO) throws XbbException;

    /**
     * 公海池升级高咨询客户生成销售机会
     * @param baseDTO
     * @author lijiangren
     * @since v1.0
     * @version v1.0
     */
    BaseVO askPublicPoolSeniorModel(BaseDTO baseDTO) throws XbbException;
}
